function setUpPage(){

    setUpPageStatus = "complete";
}

function setUp(){

}

function tearDown(){

}

function testFieldset_getType(){
    var fieldset = new zxt.ui.Fieldset();
    assertEquals("testFieldset_getType", "zxt.ui.Fieldset", fieldset.getType());
}

function testFieldset_parse(){
    var fieldset = new zxt.ui.Fieldset();
    
}

function testFieldset_render(){
    var fieldset = new zxt.ui.Fieldset();
	var f = 1;
	fieldset.renderInner = function (){
		f = 2;
	}
	var dom = fieldset.render();
	
	assertEquals("testFieldset_render_1", true, $(dom).children().is("fieldset"));
	assertEquals("testFieldset_render_2", true, $(dom).children("fieldset").children().is("legend"));
	assertEquals("testFieldset_render_3", true, $(dom).children("fieldset").children().next().is("div"));
	assertEquals("testFieldset_render_4", true, $(dom).children("fieldset").children().children().is("span"));
    assertEquals("testFieldset_render_5", true, $(dom).children("fieldset").children().children().next().is("img"));
	assertEquals("testFieldset_render_6", 2, f);
}
function testFieldset_renderInner(){
    var fieldset = new zxt.ui.Fieldset();
	
    fieldset._isfolded = true;
	fieldset.renderInner();
	assertEquals("testFieldset_renderInner_1", fieldset.SHOWICON, fieldset.$flagImg.attr("src"));
	assertEquals("testFieldset_renderInner_2", fieldset.SHOWMESS, fieldset.$legend.attr("title"));
	
	fieldset._isfolded = false;
	fieldset.renderInner();
	assertEquals("testFieldset_renderInner_3", fieldset.HIDEICON, fieldset.$flagImg.attr("src"));
	assertEquals("testFieldset_renderInner_4", fieldset.HIDEMESS, fieldset.$legend.attr("title"));
	
}

function testFieldset_openFieldset(){
    var fieldset = new zxt.ui.Fieldset();
    var f = 1;
	
	fieldset.renderInner = function (){
		f = 2;
	}
	fieldset.openFieldset();
	
	assertEquals("testFieldset_openFieldset_1", false, fieldset._isfolded);
	assertEquals("testFieldset_openFieldset_2", 2, f);
    
}

function testFieldset_closeFieldset(){
    var fieldset = new zxt.ui.Fieldset();
    var f = 1;
	
	fieldset.renderInner = function (){
		f = 2;
	}
	fieldset.closeFieldset();
	
	assertEquals("testFieldset_closeFieldset_1", true, fieldset._isfolded);
	assertEquals("testFieldset_closeFieldset_2", 2, f);
}

function testFieldset_onClick(){
    var fieldset = new zxt.ui.Fieldset();
    var o = 1;
	var c = 1;
	fieldset.openFieldset = function (){
		o++;
	}
	fieldset.closeFieldset = function (){
		c++;
	}
	
	fieldset._isfolded = true;
	fieldset.onClick();
    assertEquals("testFieldset_onClick_1", 2, o);
	assertEquals("testFieldset_onClick_2", 1, c);
	
	fieldset._isfolded = false;
	fieldset.onClick();
    assertEquals("testFieldset_onClick_3", 2, o);
	assertEquals("testFieldset_onClick_4", 2, c);
}

function testFieldset_addElement(){
    var fieldset = new zxt.ui.Fieldset();
    var f = 1;
	
	fieldset.renderInner = function (){
		f = 2;
	}
	var btn = '<input id="mybtn" type="submit"/>';
	fieldset.addElement(btn);
	
	assertEquals("testFieldset_addElement_1", "mybtn", fieldset.$contentDiv.children("input").attr("id"));
	assertEquals("testFieldset_addElement_2", 2, f);
    
}

function testFieldset_addWidget(){
    var fieldset = new zxt.ui.Fieldset();
    var f = 1;
	fieldset.renderInner = function (){
		f = 2;
	}
	var btn = new zxt.ui.Button("edit", "EDIT");
	fieldset.addWidget(btn);
	
	assertEquals("testFieldset_addWidget_1", "button", fieldset.$contentDiv.children("div").children("input").attr("type"));
	assertEquals("testFieldset_addWidget_2", 2, f);
    
}